<!--  -->
<template>
  <div>
      <div class="nav_container">
        <div class="nav">
          <div>
            <span class="title">
              个人博客
            </span>
          </div>
          <ul>
              <li v-for="(item,index) in navList" :key="index">
                <div class="content">
                  <a href="javascript:;">{{item.name}}</a>
                </div>
              </li>
          </ul>
          <div class="serach">
            <input type="text" placeholder="请输入搜索内容">
            <div class="serach_btn">
              <a href="javascript:;">搜索</a>
            </div>
          </div>
        </div>
      </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
        navList:[],
    };
  },

  created() {
    this.getNavList()
  },

  methods: {
      async getNavList(){
        await this.$http.get('/navList').then(res=>{
          this.navList = res.data.data
        })
        console.log(this.navList)
      }
  }
  
}

</script>
<style lang='less' scoped>
  .nav_container{
    width:100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    .nav{
      width:60%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      .title{
        color: #fff;
        font-weight: 800;
      }
      ul{
        width:60%;
        height: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        li{
          width: 15%;
          height: 100%;
          list-style: none;;
          .content{
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            a{
              padding-top: 30%;
              text-align: center;
              width: 100%;
              height: 100%;
              text-decoration: none;
              color: #FFF;
            }
          }
          div:hover{
            background-color: gray;
          }
        }
      
      }
      .serach{
        width: 30%;
        height: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        input{
          width: 70%;
          height: 70%;
        }
        .serach_btn{
          display: flex;
          justify-content: center;
          align-items: center;
          width: 20%;
          margin-left: 5px;
          height: 80%;
          border-radius: 2px;
          a{
            color: #FFF;
            text-decoration: none;
          }
        }
      }
    }
    
  }
</style>